<input id="file_upload" name="file_upload" type="file" />
<script type="text/javascript" src="../js/lib/uploadify/swfobject.js"></script>
<script type="text/javascript" src="../js/lib/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
	function start_uploadify() {
		$('#file_upload').uploadify({
			'uploader'   : '../js/lib/uploadify/uploadify.swf',
			'script'     : '../js/lib/uploadify/uploadify_dossiers_admin.php',
			'cancelImg'  : '../js/lib/uploadify/cancel.png',
			'folder'     : '../images/dossiers/temp/',
			'fileDesc'	 : 'Image Files',
	        'fileExt'	 : '*.jpg;*.jpeg;*.gif;*.png',
	        'onComplete': function (event, queueID, fileObj, response, data) {
	        	$("#cropbox").remove();
	        	$("#fileURL").val(fileObj.name);
	            $("#imageToCrop").append("<img  src='../images/dossiers/temp/" + fileObj.name + "' id='cropbox' />");
				$('#cropbox').Jcrop({
					aspectRatio: 1,
					onSelect: updateCoords
				});
	            $("#imageToCrop").show();
	            $("#selector").hide();
	            },  
			'auto'       : true
		});
    }
	
	start_uploadify();
</script>
<link href="../js/lib/uploadify/uploadify.css" type="text/css" rel="stylesheet" />